package com.aat.dxfy.disconf.task;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.aat.dxfy.disconf.config.RedisConfig;
import com.baidu.disconf.client.usertools.IDisconfDataGetter;
import com.baidu.disconf.client.usertools.impl.DisconfDataGetterDefaultImpl;

@Component
public class RedisConfigTask {
	protected static final Logger LOGGER = LoggerFactory.getLogger(RedisConfigTask.class);

	@Autowired
	private RedisConfig redisConfig;

	@Scheduled(cron = "0/3 * * * * ? ")
	public void test() {
		String s=redisConfig.getHost()+":"+redisConfig.getPort();
		LOGGER.info(s);
		System.out.println(s);
		
		IDisconfDataGetter iDisconfDataGetter = new DisconfDataGetterDefaultImpl();
		Map<String, Object> map =iDisconfDataGetter.getByFile("test02.properties");
		System.out.println("map "+map);
	}

}
